package com.example.julienandroid;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class Act4 extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_act4);
		Button ok=(Button) findViewById(R.id.ok);
		Button cancel=(Button) findViewById(R.id.cancel);
		ok.setOnClickListener(btnclick);
		cancel.setOnClickListener(btnclick);
	}
	

	private OnClickListener btnclick = new OnClickListener() {
		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.ok:
				Toast.makeText(getApplicationContext(), "clic sur ok",Toast.LENGTH_LONG).show();
				finish();
				break;
			}
			switch (v.getId()) {
			case R.id.cancel:
				Toast.makeText(getApplicationContext(), "clic sur cancel",Toast.LENGTH_LONG).show();
				
				break;
			}
		}
	};	
}
